

<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.Connection"%>
<%@page import="Func.Conn"%>
<%@page import="javax.swing.JOptionPane"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
     <%@ include file="head.jsp" %>

<body>
    <div id="divContainer">
        
     <%@ include file="divHeader.jsp" %>
     </br>		
    <div class="clr"></div>
    <%@ include file="divLeft.jsp" %>
    <div id = "divMid">
            <div id ="pro4">
     <%
     String HoTenKH = "";
            String CMNDKH = "";
            String DTKH = "";
            String SoTK = "";
            String Email = "";
             int dt = 0;
            String username = (String)session.getAttribute("USER");
            if(username != null)
            {


%>
<h3><font color ="red">WelCome, ${sessionScope.USER}</font></h3><br>

                <%
                try { 
            
                String USER = (String)session.getAttribute("USER");
                     try {
                
                    Connection con = Conn.GetCon();
       String sql = "Select * from KhachHang where id = '"+ username +"'";
       //   Statement stm = con.createStatement();
       Statement st = con.createStatement();
       //   stm.setString(1, username);
       // stm.setString(2, password);
       ResultSet rs = st.executeQuery(sql);
      
       while (rs.next()){  
           
           HoTenKH = rs.getString("Ho") +" "+ rs.getString("TenLot") +" "+ rs.getString("ten");
           CMNDKH = rs.getString("CMND");
           dt = rs.getInt("SDT");
           SoTK = rs.getString("SoTaiKhoan");
           Email = rs.getString("Email");
       }
       DTKH = Integer.toString(dt) ;
       
                }
                catch ( Exception e)
                                               {
                    JOptionPane.showMessageDialog(null, "" + e.getMessage());
                }

                
                }
                catch ( Exception e)
                                               {
                    JOptionPane.showMessageDialog(null, "" + e.getMessage());
                }
             
            %>
            <center><h2><font color ="blue"> Thông Tin Tài Khoản </font></h2></center><br>
<center><table border ="0" width ="40%" align ="center">
    <tr>
        <td align ="left">
            Họ Và Tên : 
        </td>
        <td align ="left">
            <% out.println(""+HoTenKH); %>
        </td>
    </tr>
     <tr>
        <td align ="left">
            Số Điện Thoại : 
        </td>
        <td align ="left">
            <% out.println(""+dt); %>
        </td>
    </tr>
     <tr>
        <td align ="left">
            Chứng Minh Nhân Dân : 
        </td>
        <td align ="left">
            <% out.println(""+CMNDKH); %>
        </td>
    </tr>
     <tr>
        <td align ="left">
            Địa chỉ email  : 
        </td>
        <td align ="left">
            <% out.println(""+Email); %>
        </td>
    </tr>
     <tr>
        <td align ="left">
            Số Tài Khoản : 
        </td>
        <td align ="left">
            <% out.println(""+SoTK); %>
        </td>
    </tr>
    
    
</table>
</center>


            <%
            }            
            else
                               {

%>
<h3> Bạn chưa đăng nhập !!! </h3> <br>
<h3> Xin mời <a href ="login.jsp"> Đăng Nhập <a/> </h3>
<%  
            }
%>


       </div>
        </div>
    <%@ include file="divFooter.jsp" %>  
         </div>

    </body>
</html>